import request from '@/utils/request'

export async function getAllCompany() {
    return await new request({
        url: '/adminSever/company',
        method: 'GET',
    })
}

export async function getCompanyInfoById(id) {
    return await new request({
        url: `/adminSever/company/${id}`,
        method: 'GET',
    })
}

export async function getCompanyInfoList(data){
  return await new request({
    url : 'adminSever/company',
    method: "POST",
    data
  })
}

export async function clearCache() {
  return await new request({
    url: 'adminSever/company/clearCache',
    method: 'GET'
  })
}

export async function saveCompanyInfo(data) {
  return await new request({
    url: 'adminSever/company/save',
    method: 'POST',
    data
  })
}

export async function modifyCompanyInfo(data) {
  return await new request({
    url: 'adminSever/company/modifyCompanyInfo',
    method: 'PUT',
    data
  })
}

export async function removeByIds(data) {
  return await new request({
    url: 'adminSever/company/removeByIds',
    method: 'DELETE',
    data
  })
}

export async function deletePhoto(data) {
  return await new request({
    url: `/adminSever/common/deletePhoto`,
    method: 'POST',
    data
  })
}

export async function updateState(id, state) {
  return await new request({
    url: `/adminSever/company/updateState/${id}/${state}`,
    method: 'GET',
  })
}

export async function companyInfoByIds(data) {
  return await new request({
    url: `/adminSever/company/companyInfoByIds`,
    method: 'POST',
    data
  })
}


